home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 2.0.1 / Experimental enhancements / MacApp Sizers / SizerTest.r < prev    next >
Text File  |  1990-11-08  |  9KB  |  310 lines

  1. /* • Auto-Include the requirements for this source */
  2.  
  3. #ifndef __TYPES.R__
  4. #include "Types.r"
  5. #endif
  6.  
  7. #ifndef __SYSTYPES.R__
  8. #include "SysTypes.r"
  9. #endif
  10.  
  11. #ifndef __MacAppTypes__
  12. #include "MacAppTypes.r"
  13. #endif
  14.  
  15. #ifndef __ViewTypes__
  16. #include "ViewTypes.r"
  17. #endif
  18.  
  19. #if qDebug
  20. include "Debug.r.o";
  21. #endif
  22.  
  23. include "MacApp.r.o";
  24. include "Dialog.r.o";
  25.  
  26.  
  27. include $$Shell("ObjApp")$$Shell("XAppName") 'CODE';
  28.  
  29. #define kSignature            'Test'            // Application signature
  30. #define kFileType            'test'            // Data file type
  31.  
  32. #define listFont        plain,    9, {0, 0, 0}, "geneva"
  33.  
  34.  
  35. /* Include resources from the Sizer unit */
  36. #include "USizerView.r"
  37.  
  38.  
  39. /* Commands */
  40. #define cNewTestWindow    1200             // Create a new test window procedurally
  41. #define cNewSplitHWindow    1205        // Create a new window with horizontal sizer & splitter
  42. #define cNewSplitVWindow    1206        // Create a new window with vertical sizer & splitter
  43.  
  44.  
  45. /* Resources */
  46.  
  47. #define kTestWindowID    1001             // ID of the main window
  48. #define kSplitHWindowId    1205            // Window resource for cNewSplitHWindow
  49. #define kSplitVWindowId    1206            // Window resource for cNewSplitVWindow
  50.  
  51. #define mTest    4
  52.  
  53. /* STR# resources for 4-pane SizerView */
  54. #define kStringList1    2000
  55. #define kStringList2    2001
  56. #define kStringList3    2002
  57. #define kStringList4    2003
  58.  
  59.  
  60. /* Miscellaneous constants */
  61.  
  62. #define kWindowWidth    400
  63. #define kWindowHeight    400
  64. #define    kListPaneWidth    100-kSBarSizeMinus1
  65. #define kListPaneHeight    200
  66.  
  67. resource 'view' (kTestWindowID, "TestWindowType", purgeable) {
  68.     {
  69.     root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
  70.                 notShown, enabled,
  71.         Window    { "", zoomDocProc, goAwayBox, resizable, modeless,
  72.                 ignoreFirstClick, freeOnClosing, disposeOnFree, closesDocument,
  73.                 openWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
  74.                 dontCenter, 'aaaa', "SizerView Test" };
  75.  
  76.     'WIND', 'main', { 0, 0 }, { kWindowHeight, kWindowWidth },
  77.                 sizeSuperView, sizeSuperView, shown, enabled,
  78.         View { "THorizontalSizer" };
  79.  
  80.     'main', 'lowr', { 203, 0 }, { 197, kWindowWidth },
  81.                 sizeRelSuperView, sizeSuperView, shown, enabled,
  82.         View    { "TTestView" };
  83.                 
  84.     'main', 'uppr', { 0, 0 }, { kListPaneHeight, kWindowWidth },
  85.                 sizeRelSuperView, sizeSuperView, shown, enabled,
  86.         View { "TVerticalSizer" };
  87.  
  88.     'uppr', 'SCL1', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
  89.                 sizeSuperView, sizeRelSuperView, shown, enabled,
  90.         Scroller    { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
  91.                 vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
  92.  
  93.     'SCL1', 'aaaa', { 0, 0 }, { kListPaneHeight, kListPaneWidth }, 
  94.                 sizeVariable, sizeSuperView, shown, enabled,
  95.         TextListView    { "TTestListView", 0, 1, 12, 12, 0, 4,
  96.                 dontAdornRows, dontAdornCols, singleSelection, listFont };
  97.  
  98.     'uppr', 'SCL3', { 0, 160 }, { kListPaneHeight, kListPaneWidth },
  99.                 sizeSuperView, sizeRelSuperView, shown, enabled,
  100.         Scroller    { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
  101.                 vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
  102.  
  103.     'SCL3', 'cccc', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
  104.                 sizeVariable, sizeSuperView, shown, enabled,
  105.         TextListView    { "TTestListView", 0, 1, 12, 12, 0, 4,
  106.                 dontAdornRows, dontAdornCols, singleSelection, listFont };
  107.  
  108.     'uppr', 'SCL2', { 0, 80 }, { kListPaneHeight, kListPaneWidth },
  109.                 sizeSuperView, sizeRelSuperView, shown, enabled,
  110.         Scroller    { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
  111.                 vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
  112.  
  113.     'SCL2', 'bbbb', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
  114.                 sizeVariable, sizeSuperView, shown, enabled,
  115.         TextListView    { "TTestListView", 0, 1, 12, 12, 0, 4,
  116.                 dontAdornRows, dontAdornCols, singleSelection, listFont };
  117.  
  118.     'uppr', 'SCL4', { 0, 240 }, { kListPaneHeight, kListPaneWidth },
  119.                 sizeSuperView, sizeRelSuperView, shown, enabled,
  120.         Scroller    { "", vertScrollBar, noHorzScrollBar, 0, 0, 12, 12,
  121.                 vertConstrain, noHorzConstrain, { 0, 0, 0, 0 } };
  122.  
  123.     'SCL4', 'dddd', { 0, 0 }, { kListPaneHeight, kListPaneWidth },
  124.                 sizeVariable, sizeSuperView, shown, enabled,
  125.         TextListView    { "TTestListView", 0, 1, 12, 12, 0, 4,
  126.                 dontAdornRows, dontAdornCols, singleSelection, listFont };
  127.     }
  128. };
  129.  
  130. resource 'STR#'    (kStringList1) {
  131.     {
  132. /* [1] */    "One";
  133. /* [2] */    "Two";
  134. /* [3] */    "Three";
  135. /* [4] */    "Four";
  136. /* [5] */    "Five";    
  137. /* [6] */    "Six";
  138. /* [7] */    "Seven";
  139. /* [8] */    "Eight";
  140. /* [9] */    "Nine"
  141.     }
  142. };
  143.  
  144. resource 'STR#'    (kStringList2) {
  145.     {
  146. /* [1] */    "First";
  147. /* [2] */    "Second";
  148. /* [3] */    "Third";
  149. /* [4] */    "Fourth";
  150. /* [5] */    "Fifth";    
  151. /* [6] */    "Sixth";
  152. /* [7] */    "Seventh";
  153. /* [8] */    "Eighth"
  154.     }
  155. };
  156.  
  157. resource 'STR#'    (kStringList3) {
  158.     {
  159. /* [1] */    "1";
  160. /* [2] */    "2";
  161. /* [3] */    "3";
  162. /* [4] */    "4";
  163. /* [5] */    "5";    
  164. /* [6] */    "6";
  165. /* [7] */    "7";
  166. /* [8] */    "8";
  167. /* [9] */    "9";
  168. /* [10] */    "10";
  169. /* [11] */    "11";
  170. /* [12] */    "12";
  171.     }
  172. };
  173.  
  174. resource 'STR#'    (kStringList4) {
  175.     {
  176. /* [1] */    "a";
  177. /* [2] */    "b";
  178. /* [3] */    "c";
  179. /* [4] */    "d";
  180. /* [5] */    "e";    
  181. /* [6] */    "f";
  182. /* [7] */    "g";
  183. /* [8] */    "h";
  184. /* [9] */    "i"
  185.     }
  186. };
  187.  
  188. #define kWindowWidth    300
  189. #define kWindowHeight    400
  190. #define kSplitterThickness    6        // thickness of a TSplitter
  191.  
  192. resource 'view' (kSplitHWindowId, "Horiz Split Window", purgeable) {
  193.     {
  194.     root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
  195.                 notShown, enabled,
  196.         Window    { "", zoomDocProc, goAwayBox, resizable, modeless,
  197.                 ignoreFirstClick, freeOnClosing, disposeOnFree, doesntCloseDocument,
  198.                 dontOpenWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
  199.                 dontCenter, 'hsiz', "Horizontal Splitter Test" };
  200.  
  201.     'WIND', 'hsiz', { 0, 0 }, { kWindowHeight, kWindowWidth },
  202.                 sizeSuperView, sizeSuperView, shown, enabled,
  203.         View { "THorizontalSizer" };
  204.  
  205.     'hsiz', 'SCLH', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth-kSBarSizeMinus1 },
  206.                 sizeRelSuperView, sizeRelSuperView, shown, enabled,
  207.         Scroller    { "", vertScrollBar, noHorzScrollBar, 0, 0, 16, 16,
  208.                 vertConstrain, noHorzConstrain, { kSplitterThickness, 0, 0, 0 } };
  209.  
  210.     'SCLH', 'stpd', { 0, 0 }, { 500, kWindowWidth-kSBarSizeMinus1 },
  211.                 sizeFixed, sizeSuperView, shown, enabled,
  212.         View { "TStupidView" };
  213.  
  214.     'hsiz', 'SPLT', { 0, kWindowWidth-kSBarSizeMinus1 }, { kSplitterThickness, kSBarSizeMinus1 },
  215.                 sizeFixed, sizeRelSuperView, shown, enabled,
  216.         Control    { "TSplitter",
  217.                 noAdornment, notSizeable, notDimmed, notHilited, doesntDismiss,
  218.                 noInset, systemFont };
  219.     }
  220. };
  221.  
  222. #define kWindowWidth    400
  223. #define kWindowHeight    300
  224.  
  225. resource 'view' (kSplitVWindowId, "Vert Split Window", purgeable) {
  226.     {
  227.     root, 'WIND', { 30, 30 }, { kWindowHeight, kWindowWidth }, sizeVariable, sizeVariable,
  228.                 notShown, enabled,
  229.         Window    { "", zoomDocProc, goAwayBox, resizable, modeless,
  230.                 ignoreFirstClick, freeOnClosing, disposeOnFree, doesntCloseDocument,
  231.                 dontOpenWithDocument, dontAdaptToScreen, stagger, dontForceOnScreen,
  232.                 dontCenter, 'vsiz', "Vertical Splitter Test" };
  233.  
  234.     'WIND', 'vsiz', { 0, 0 }, { kWindowHeight, kWindowWidth },
  235.                 sizeSuperView, sizeSuperView, shown, enabled,
  236.         View { "TVerticalSizer" };
  237.  
  238.     'vsiz', 'SCLV', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth-kSBarSizeMinus1 },
  239.                 sizeRelSuperView, sizeRelSuperView, shown, enabled,
  240.         Scroller    { "", noVertScrollBar, horzScrollBar, 0, 0, 16, 16,
  241.                 noVertConstrain, horzConstrain, { 0, kSplitterThickness, 0, 0 } };
  242.  
  243.     'SCLV', 'stpd', { 0, 0 }, { kWindowHeight-kSBarSizeMinus1, kWindowWidth },
  244.                 sizeRelSuperView, sizeSuperView, shown, enabled,
  245.         View { "TStupidView" };
  246.  
  247.     'vsiz', 'SPLT', { kWindowHeight-kSBarSizeMinus1, 0 }, { kSBarSizeMinus1, kSplitterThickness },
  248.                 sizeRelSuperView, sizeFixed, shown, enabled,
  249.         Control    { "TSplitter",
  250.                 noAdornment, notSizeable, notDimmed, notHilited, doesntDismiss,
  251.                 noInset, systemFont };
  252.     }
  253. };
  254.  
  255. /******************** M E N U S ****************************************************/
  256.  
  257. include "Defaults.r.o" 'cmnu' (mApple);    // Grab the default Apple menu
  258. include "Defaults.r.o" 'cmnu' (mFile);        // Grab the default File menu
  259. include "Defaults.r.o" 'cmnu' (mEdit);        // Grab the default Edit menu
  260.  
  261. resource 'cmnu' (mTest) {
  262.     mTest,
  263.     textMenuProc,
  264.     0x7FFFFFFB,
  265.     enabled,
  266.     "Test",
  267.      {
  268. /* [1] */ "New Horizontal Split Window",    noIcon, "1", check, plain, cNewSplitHWindow;
  269. /* [2] */ "New Vertical Split Window",        noIcon, "2", check, plain, cNewSplitVWindow
  270.     }
  271. };
  272.  
  273. resource 'MBAR' (kMBarDisplayed) {
  274.     { mApple; mFile; mEdit; mTest }
  275. };
  276.  
  277. include "Defaults.r.o" 'ALRT' (phAboutApp);        // Get default About Box
  278. include "Defaults.r.o" 'DITL' (phAboutApp);        // …and its item list
  279.  
  280. resource 'STR#' (kDefaultCredits, purgeable) {
  281.      {
  282.     "Keith Rollin";
  283.     "Lonnie Millett";
  284.     "Tom Chavez";
  285.     "The White Stalker";
  286.     "The Dark Fluffy"
  287.      }
  288. };
  289.  
  290. /**********************************************************************************/
  291.  
  292. type kSignature as 'STR ';                            // Creator string
  293.  
  294. resource  kSignature (0) {
  295.     "USizerView test program.   MacApp is my friend."    // the ID string as part of Bundle
  296. };
  297.  
  298.  
  299. /* The version of this application */
  300.  
  301. RESOURCE 'vers' (1, purgeable) {
  302.     0x01,
  303.     0x00,
  304.     development,
  305.     0x00,
  306.     verUs,
  307.     "1.0",
  308.     "Test 1.0, ©Apple Computer, Inc. 1990"
  309. };
  310.